package com.qinglei.recoup.system.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qinglei.recoup.system.domain.TBedHealthDailyStatisticsData;
import com.qinglei.recoup.system.domain.TableFeatures;
import com.qinglei.recoup.system.domain.vo.DeanRotationVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface TBedHealthDailyStatisticsDataMapper extends BaseMapper<TBedHealthDailyStatisticsData> {

    void insertData(TBedHealthDailyStatisticsData   data);
    void deleteByDate(@Param("date") LocalDate date);

    List<TBedHealthDailyStatisticsData> getTop(@Param("date") LocalDate date,@Param("deanIds") List<Integer> deanIds,@Param("orderByColumnName")String orderByColumnName);

    List<TBedHealthDailyStatisticsData> getRotationTopList(DeanRotationVo vo);

    TBedHealthDailyStatisticsData getRotationByIdAndDate(TBedHealthDailyStatisticsData vo);

    Integer getRotationTopListCount(DeanRotationVo vo);

    TBedHealthDailyStatisticsData getBedCountNumber(@Param("startDate")String startDate,@Param("endDate") String endDate,@Param("deanIds") List<Integer> deanIds,@Param("dayNum") Integer dayNum);

    List<TBedHealthDailyStatisticsData> getDataByBedIdAndDate(@Param("startDate")String startDate,@Param("endDate") String endDate,@Param("deanIds") List<Integer> deanIds);

    List<Integer> getSleepScoreMedian(@Param("startDate")String startDate,@Param("endDate") String endDate,@Param("deanIds") List<Integer> deanIds);

}